Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding examples created for previous demo #287

Merged
merged 9 commits into from
Sep 19, 2017

Conversation

adriane-cardozo
Copy link
Collaborator

Description

Examples for creating server profile with boot from SAN, migrate volume from one hw to another and migrate server profile from one hw to another

Issues Resolved

NA

Check List

  • New functionality includes testing.
    • All tests pass. ($ ./build.sh).
  • New functionality has been documented in the README if applicable.
    • New functionality has been thoroughly documented in the examples (please include helpful comments).

…te volume from one hw to another and migrate server profile from one hw to another
name: "{{ profile_name }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
server_hardware: "{{ server_hardware_name }}"
Copy link
Contributor

@fgbulsoni fgbulsoni Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work anymore as server_hardware was not following the style guide from other fields. It should be serverHardwareName now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

name: "{{ profile_name }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
server_hardware: "{{ server_hardware_name }}"
Copy link
Contributor

@fgbulsoni fgbulsoni Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work anymore as server_hardware was not following the style guide from other fields. It should be serverHardwareName now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

name: "{{ profile_name1 }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
server_hardware: "{{ server_hardware_name1 }}"
Copy link
Contributor

@fgbulsoni fgbulsoni Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work anymore as server_hardware was not following the style guide from other fields. It should be serverHardwareName now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

oneview_server_profile:
config: "{{ config }}"
data:
server_hardware: "{{ server_hardware_name2 }}"
Copy link
Contributor

@fgbulsoni fgbulsoni Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work anymore as server_hardware was not following the style guide from other fields. It should be serverHardwareName now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

name: "{{ profile_name1 }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
server_hardware: "{{ server_hardware_name2 }}"
Copy link
Contributor

@fgbulsoni fgbulsoni Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work anymore as server_hardware was not following the style guide from other fields. It should be serverHardwareName now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

oneview_server_profile:
config: "{{ config }}"
data:
server_hardware: "{{ server_hardware_name }}"
Copy link
Contributor

@fgbulsoni fgbulsoni Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work anymore as server_hardware was not following the style guide from other fields. It should be serverHardwareName now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

config: "{{ config }}"
data:
server_hardware: "{{ server_hardware_name }}"
server_template: "{{ server_profile_template }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work anymore as server_template was not following the style guide from other fields. It should be serverProfileTemplateName now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

config: "{{ config }}"
data:
server_hardware: "{{ server_hardware_name2 }}"
server_template: "{{ server_profile_template }}"
Copy link
Contributor

@fgbulsoni fgbulsoni Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work anymore as server_template was not following the style guide from other fields. It should be serverProfileTemplateName now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@fgbulsoni
Copy link
Contributor

I'd also try improving the example names, perhaps add in a prefix like 'server_profile_' + scenario that it covers.
Also, perhaps its worth having a Demo or PoC folder inside examples

Copy link
Contributor

@tmiotto tmiotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I really don't understand which is the code difference between the examples. Try to:
    a. Create from a template that has the common data and override only the target parameters
    b. Comment the playbook specifying exactly what need to be changed to accomplish the examples
  2. Try improving the playbook names, for some of them I couldn't get what you were intending to do
  3. Try improving the task names, saying exactly what they do, like "Ensures Server Profile X has two SAN connections in volume Y"

server_hardware_type_name: "SY 480 Gen9 3"
enclosure_group_name: "SYN107_EG"
server_hardware_name1: "2-USE722C99W-M, bay 1"
server_hardware_name2: "2-USE722C99W-M, bay 11"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your file name says it will migrate from 1 to 12, but your file does the miration from 1 to 11. Try changing the name of the example to be more generic, like server_profile_migrate_bays

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

powerControl: "PressAndHold"
delegate_to: localhost

- name : "Create/Update Server Profile - {{ profile_name1 }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify exactly what are you trying to accomplish with this task

Copy link
Contributor

@fgbulsoni fgbulsoni Sep 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One caveat here though:
Since we now do not require the server hardware to be off, the bay1 would not even need to be declared in this file, and due to the declarative way of Ansible/Yaml this would just be listing bayX.

The way the example would read, would be simple and not actually adding value.

I'd say we should either create the original SP in this example and THEN change the blade it is using (thus illustrating the change), or drop this example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, please review if now it makes sense (five steps in the demo folder).


tasks:

- name: Power Off the server hardware
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which server hardware? You specified two server hardwares.

Also, don't you need to power off both server hardwares?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, with the current module, I guess you don't need to care if the server hardwares are powered off while operating a server profile, the code already checks and power them off if necessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ This.
Since it should be working independently of the power state of the server hardwares, this example is illustrating something we don't really want to be doing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I removed the first task and updated the description.

@@ -0,0 +1,44 @@
###
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems kind of pointless to me, it lists creating a SP based on a template and powering it on, but that is already illustrated in the basic oneview_server_profile.yml example: link

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but it was part of the requested scenarios, I renamed to step 3 and use it again in step 4, so the user can compare tasks.

@adriane-cardozo adriane-cardozo force-pushed the adding_more_examples_use_cases branch from e8c2095 to 51deab5 Compare September 11, 2017 21:17
Copy link
Collaborator Author

@adriane-cardozo adriane-cardozo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created a demo folder and renamed files to show the steps illustrated, also updated name of parameters.

@adriane-cardozo adriane-cardozo force-pushed the adding_more_examples_use_cases branch 3 times, most recently from 54f3f92 to cc802ba Compare September 14, 2017 18:46

This demo is composed by 5 steps, each one associated with a playbook, that should be executed in the specified order:

- `step_1_create_server_profile_boot_from_SAN_and_assign_to_bay1.yml`: This playbook exemplifies how to create a server profile with boot from SAN (3PAR) and without using a template. On task #1, the server profile is created (if not already present) and assigned to server hardware in bay 1. You can check all parameters, including those related to the server hardware and those related to the storage as SAN connections and volume attachment. The volume must be ready to use. On task #2, the server hardware is powered on.
Copy link
Contributor

@fgbulsoni fgbulsoni Sep 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest swapping out this style of writing:
'On task #1,' >>>

For this one:
It performs 2 tasks:

  1. The server profile is created (...)
  2. The server hardware is powered on.

This is specially important since the #1 and #2 in this will actually automatically link to issues which is not the intended purpose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1 and #2 were not converted to links, but I changed to the suggested format.

@@ -0,0 +1,17 @@
# Demo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, name of the folder seems weird to me.
Perhaps boot_from_SAN+server_profile_and_volume_migration?
boot_from_SAN&volume_migration?

Not really enjoying any a lot, @tmiotto any bright ideas here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe boot_from_san_and_migration There is no need to be that level of specific in the title.


- `step_1_create_server_profile_boot_from_SAN_and_assign_to_bay1.yml`: This playbook exemplifies how to create a server profile with boot from SAN (3PAR) and without using a template. On task #1, the server profile is created (if not already present) and assigned to server hardware in bay 1. You can check all parameters, including those related to the server hardware and those related to the storage as SAN connections and volume attachment. The volume must be ready to use. On task #2, the server hardware is powered on.

- `step_2_based_on_server_profile_boot_from_SAN_add_another_volume.yml`: This playbook exemplifies how to add an extra volume attachment to an existing server profile. Task #1 was copied from step 1 and a new volume attachment was added identified by id 2. When this task is executed, the additional volume becomes available to the operating system.
Copy link
Contributor

@fgbulsoni fgbulsoni Sep 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the titles here I'd suggest linking to the example and making the titles more readable, as this does not need to be the name of the file.

I'd then drop the description to the line bellow them:

Step 1 - Do something really amazing

This playbook performs amazing feats! Keep reading to understand the secrets of the universe (...)

Step 2 - Add extra volume to existing server profile

This playbook exemplifies (...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Changed.

@@ -0,0 +1,17 @@
# Demo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe boot_from_san_and_migration There is no need to be that level of specific in the title.


- `step_2_based_on_server_profile_boot_from_SAN_add_another_volume.yml`: This playbook exemplifies how to add an extra volume attachment to an existing server profile. Task #1 was copied from step 1 and a new volume attachment was added identified by id 2. When this task is executed, the additional volume becomes available to the operating system.

- `step_3_create_server_profile_based_on_server_profile_template_and_assign_to_bay12.yml`: This playbook exemplifies how to create a server profile using a server profile template. On task #1, the server profile is created (if not already present) and assigned to server hardware in bay 12. In this case, all settings were configured in the template, including network connections and OS deployment plan to use Image Streamer. On task #2, the server hardware is powered on.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to be that specific in the title, also it would be good not mentioning values that may vary from user to user like bay12. You could simple call this create_server_profile_from_template

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Changed.

@adriane-cardozo adriane-cardozo force-pushed the adding_more_examples_use_cases branch 4 times, most recently from b739428 to 1d181e0 Compare September 15, 2017 13:33
@adriane-cardozo adriane-cardozo force-pushed the adding_more_examples_use_cases branch from 1d181e0 to f94b29e Compare September 15, 2017 13:41

### [Step 4 - Migrate a data volume to another server profile](step_4_migrate_data_volume.yml)
This playbook exemplifies how to migrate a data volume from one server profile to another. It performs 2 tasks:
1. Task copied from step 2 when the extra volume was attached. This task updates the server profile 'profile_san' removing data volume identified by id 2 (returning to the original state - same as in the step 1).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is returning the resource to the state it was in step 1, was it really copied from step 2?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps:
Updates the server profile 'profile_san' to match its original state in Step 1, removing the data volume identified by id 2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Changed.

### [Step 4 - Migrate a data volume to another server profile](step_4_migrate_data_volume.yml)
This playbook exemplifies how to migrate a data volume from one server profile to another. It performs 2 tasks:
1. Task copied from step 2 when the extra volume was attached. This task updates the server profile 'profile_san' removing data volume identified by id 2 (returning to the original state - same as in the step 1).
2. Task copied from step 3 to update server profile 'profile_i3s' inserting data volume removed from previous task. The connectionId used by the storage paths need to be updated to match with the SAN connections. In this case, the SAN connection ids in the server profile template were 4 and 5.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing we can just remove the 'Task copied from' part. Starting on 'Update server profile (...)' seems explanatory enough

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Changed

@@ -0,0 +1,28 @@
# Demo:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps remove this line? It is already inside the demos folder, kind of expected to be a demo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Done

Copy link
Contributor

@fgbulsoni fgbulsoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few extra changes requested, after those are in I'm probably good with the PR.

1. Task copied from step 2 when the extra volume was attached. This task updates the server profile 'profile_san' removing data volume identified by id 2 (returning to the original state - same as in the step 1).
2. Task copied from step 3 to update server profile 'profile_i3s' inserting data volume removed from previous task. The connectionId used by the storage paths need to be updated to match with the SAN connections. In this case, the SAN connection ids in the server profile template were 4 and 5.
1. Updates server profile 'profile_san' to match its original state on step 1, removing data volume identified by id 2.
2. Updates server profile 'profile_i3s' inserting data volume removed from previous task. The connectionId used by the storage paths need to be updated to match with the SAN connections. In this case, the SAN connection ids in the server profile template were 4 and 5.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates server profile 'profile_i3s' inserting the data volume removed from in the previous task. The connectionId used by the storage paths needs to be updated to match with the SAN connections. In this case, the SAN connection ids in the server profile template were 4 and 5.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -19,8 +18,8 @@ This playbook exemplifies how to create a server profile using a server profile

### [Step 4 - Migrate a data volume to another server profile](step_4_migrate_data_volume.yml)
This playbook exemplifies how to migrate a data volume from one server profile to another. It performs 2 tasks:
1. Task copied from step 2 when the extra volume was attached. This task updates the server profile 'profile_san' removing data volume identified by id 2 (returning to the original state - same as in the step 1).
2. Task copied from step 3 to update server profile 'profile_i3s' inserting data volume removed from previous task. The connectionId used by the storage paths need to be updated to match with the SAN connections. In this case, the SAN connection ids in the server profile template were 4 and 5.
1. Updates server profile 'profile_san' to match its original state on step 1, removing data volume identified by id 2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates server profile 'profile_san' to match its original state on step 1, removing the data volume identified by id 2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@adriane-cardozo adriane-cardozo merged commit 86f6bf5 into master Sep 19, 2017
@fgbulsoni fgbulsoni deleted the adding_more_examples_use_cases branch September 19, 2017 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants